<template>
	<view>
		<view class="classcard">
			<text>当前班级 : {{thisclass}}</text>
		</view>
			<view style="width: 30%; margin: 15px;">
				<navigator url="/pages/dongtai/say">
					<button type="primary" size="mini">发表动态</button>
				</navigator>
				
			</view>
			<view v-for="(item,index) in items" :key="item.title">
				<u-card :title="item.title" :sub-title="item.user">
						<view class="" slot="body">
							<view class="u-body-item u-flex u-row-between u-p-b-0">
							<view class="u-body-item-title u-line-2">{{item.text}}</view>
							</view>
						</view>	
				</u-card>
			</view>
	</view>
</template>

<script>
	
	import uniFab from '@/components/uni-fab/uni-fab.vue';
	
	export default {
		
		components: {
		    uniFab
		},
		data: {
	        text: 'uni-app',

	    },
		onLoad() {
			
		
		},
	    data(){
			
			return {
				items: [ 
					{"aid":1,"user":"不断同学","title":"欢迎","text":"\u4f60\u597d\uff0c\u6211\u8981\u8d77\u98de\u8d77\u98de\u8d77\u98de","time":1616286536},
					{"aid":2,"user":"不断同学","title":"你好","text":"\u4f60\u597d\uff0c\u6211\u8981\u8d77\u98de\u8d77\u98de\u8d77\u98de","time":1616286537}
				],
				thisclass : "测试班级",
				cardtitle:"标题",
				cardsubTitle:"发布者",
				list: [{
					name: '动态'
				}, {
					name: '图片',
					count: 2
				}],
				current: 0
			}
		},
		onLoad() {
			
			uni.request({
				url:'http://api.cc.me:8888/test.php',
				success:function(res){
					this.items = res.data,
					console.log(this.items)
				}
			})
			
			
		},
		methods:{
			
			triggerfab(e) {
				this.content[e.index].active = !e.item.active ;
				uni.navigateTo({
					url: 'say?active=' + e.item.text ,
				});
				this.e.item.active = false

			},
			change(index) {
				this.current = index;
			},
			
			
		},
		
	

	}
</script>

<style>
	
	.classcard{
		background-color: #FFF2D2;
		margin: 12px;
		padding: 8px;
		
	}
	.wrap {
		padding: 40rpx;
	}

	.logo {
		height: 200rpx;
		width: 200rpx;
		margin-top: 200rpx;
		margin-left: auto;
		margin-right: auto;
		margin-bottom: 50rpx;
	}

	.text-area {
		display: flex;
		justify-content: center;
	}

	.title {
		font-size: 36rpx;
		color: #8f8f94;
	}
</style>
